<template>
	<el-card class="form-container">
		<el-form :model="editForm" ref="editForm" :rules="dataRule" @keyup.enter.native="dataFormSubmitHandle()" label-width="90px">
			<el-form-item label="分类名称" prop="categoryName">
				<el-input v-model="editForm.categoryName" placeholder="请输入分类名称"></el-input>
			</el-form-item>
			<el-form-item label="类目父编号" prop="categoryParentCode">
				<el-input v-model="editForm.categoryParentCode" placeholder="请输入类目父编号"></el-input>
			</el-form-item>
			<el-form-item label="分类图标/图片" prop="categoryIcon">
				<el-input v-model="editForm.categoryIcon" placeholder="请输入分类图标/图片"></el-input>
			</el-form-item>
			<el-form-item label="分类级别 1.一级类目 2.二级类目 3.三级类目" prop="categoryLevel">
				<el-input v-model="editForm.categoryLevel" placeholder="请输入分类级别 1.一级类目 2.二级类目 3.三级类目"></el-input>
			</el-form-item>
			<el-form-item label="类目排序" prop="categorySort">
				<el-input v-model="editForm.categorySort" placeholder="请输入类目排序"></el-input>
			</el-form-item>
			<el-form-item label="类目状态 1.启用 2.禁用" prop="categoryStatus">
				<el-input v-model="editForm.categoryStatus" placeholder="请输入类目状态 1.启用 2.禁用"></el-input>
			</el-form-item>
			<el-form-item label="创建时间" prop="createTime">
				<el-input v-model="editForm.createTime" placeholder="请输入创建时间"></el-input>
			</el-form-item>
			<el-form-item label="修改时间" prop="updateTime">
				<el-input v-model="editForm.updateTime" placeholder="请输入修改时间"></el-input>
			</el-form-item>
			<el-form-item label="类目编号" prop="categoryCode">
				<el-input v-model="editForm.categoryCode" placeholder="请输入类目编号"></el-input>
			</el-form-item>
			<el-form-item label="模版编号:当前类目所对应的模版信息,方便用户快速录入信息" prop="templateCode">
				<el-input v-model="editForm.templateCode" placeholder="请输入模版编号:当前类目所对应的模版信息,方便用户快速录入信息"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button @click="cancel">取消</el-button>
				<el-button type="primary" @click="submit('dataForm')">确定</el-button>
			</el-form-item>
		</el-form>
	</el-card>
</template>

<script>
	import { findGoodsCategoryDetail } from '@/api/mall/goodsCategory'
	export default {
		name: 'user-goodsCategory',
		data() {
			return {
				editForm: {
					categoryName: '',
					categoryParentCode: '',
					categoryIcon: '',
					categoryLevel: '',
					categorySort: '',
					categoryStatus: '',
					createTime: '',
					updateTime: '',
					categoryCode: '',
					templateCode: '',
				}
			}
		},
		created() {
			this.editForm.id = this.$route.query.id
			this.view(this.$route.query.id)
		},
		methods: {
			view(val) {
				findGoodsCategoryDetail(val).then(res => {
					this.editForm = res.data.responseData
				})
			},
			cancel() {
				this.$router.go(-1)
			},
			update() {

			}
		}
	}
</script>

<style>
</style>
